Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add assertVisible and assertMissing assertions #35

Merged
merged 4 commits into from
Feb 17, 2025

Conversation

dzmitry-vasileuski
Copy link
Contributor

@dzmitry-vasileuski dzmitry-vasileuski commented Feb 16, 2025

Add assertVisible (https://laravel.com/docs/11.x/dusk#assert-visible) and assertMissing (https://laravel.com/docs/11.x/dusk#assert-missing) assertions.

⚠️I used Dusk assertion names. But I don't think missing is a good name for such assertion. Would be better to have assertHidden instead. Probably, we can add this method to the PendingTest as an alias to assertMissing.

@dzmitry-vasileuski dzmitry-vasileuski changed the title feat: add assertVisible and assertMissing assertions Add assertVisible and assertMissing assertions Feb 16, 2025
@ijpatricio
Copy link
Collaborator

Hello again @dzmitry-vasileuski

You may have some point here, but since the instructions are clear (and you seem to be very aware), of following Dusk's API, let's go with that.

Like before, can you please add the relevant documentation part, in the README.md?

There's already example there, following Dusk's guidelines

### Available Assertions

<a name="assert-dont-see"></a>
#### assertDontSee

Assert that the given text is not present on the page:

```php
test('assert does not see', function () {
    $url = 'https://laravel.com';

    $this->visit($url)
        ->assertDontSee('we are a streaming service');
});

@ijpatricio ijpatricio added the awaits documentation Pull request misses documentation label Feb 17, 2025
@dzmitry-vasileuski
Copy link
Contributor Author

@ijpatricio
Updated doc.

@ijpatricio
Copy link
Collaborator

Woohoo, thanks @dzmitry-vasileuski

@ijpatricio ijpatricio merged commit 86289d2 into pestphp:main Feb 17, 2025
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaits documentation Pull request misses documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants